<%--
  Created by IntelliJ IDEA.
  User: Yzk20
  Date: 2025/6/24
  Time: 9:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../public.jsp"%>
<html>
<head>
  <title>Title</title>
  <link rel="stylesheet" type="text/css" href="css/styless.css">
</head>
<body>
<form action="<%=pageContext.getServletContext().getContextPath()%>/bookServlet">
<%
  String bookid = request.getParameter("bookid");//图书ID

  String sql = "select * from books t where bookid= '"+bookid+"'";
  Statement stmt=conn.createStatement();
  ResultSet rs=stmt.executeQuery(sql);
  String bookName=null;
  String bookType=null;
  String author=null;
  String date=null;
  while (rs.next()){
    bookName=rs.getString("bookName");
    bookType=rs.getString("bookType");
    author=rs.getString("author");
    date=rs.getString("date");
  }

%>

<table align="center" width="50%" >
  <tr>
    <td><input type="hidden"  name="actionType"  value="book_update"></td>
    <td><input type="hidden"  name="bookid"  id="bookid" value="<%=bookid%>"></td>
  </tr>
  <tr>
    <td>图书名称：<input type="text" name="bookName" id="bookName" value="<%=bookName%>"></td>
  </tr>
  <tr>
    <td>图书类型：<input type="text" name="bookType" id="bookType" value="<%=bookType%>"></td>
  </tr>
  <tr>
    <td>作者
      <input type="text" name="author"  id="author" value="<%=author%>"></td>
  </tr>
  <tr>
    <td>出版日期
      <input type="date" placeholder="请选择出版日期" name="date" id="date" value="<%=date%>">
    </td>

  </tr>
  <tr>
    <td colspan="2 " onclick="">
      <input type="submit" value="提交">
    </td>
  </tr>
</table>
</form>
</body>
</html>